package com.miya.demo.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.ibatis.type.JdbcType;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 基础的实体
 *
 * @author Caixiaowei
 * @date 2022/07/08
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class BaseEntity {

    /**
     * 主键id
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 删除标识: 0-未删除; 1-已删除
     */
    @TableField(value = "delete_status")
    private Boolean deleteStatus;

    /**
     * 创建人
     */
    @TableField(value = "create_by", jdbcType = JdbcType.INTEGER, fill = FieldFill.INSERT)
    private Long createBy;

    /**
     * 创建时间
     */
    @TableField(value = "create_time", jdbcType = JdbcType.DATE, fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    /**
     * 更新人
     */
    @TableField(value = "update_by", jdbcType = JdbcType.INTEGER, fill = FieldFill.INSERT_UPDATE)
    private Long updateBy;

    /**
     * 更新时间
     */
    @TableField(value = "update_time", jdbcType = JdbcType.DATE, fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;
}
